const { forMatObject } = require('../utils/index');
const handleParams = (req, res, next) => {
    // 处理参数
    try {
        if (Object.keys(req.body).length != 0) {
            req.body = forMatObject(req.body);
        }
        if (Object.keys(req.query).length != 0) {
            req.query = forMatObject(req.query);
        }
    } catch (error) {
        console.log(error);
    }
    next();
}

module.exports = handleParams;